
export default `
import zipfile from '@feidao/web/atom/nodejs/zip/zip';
import html2docx from '@feidao/web/atom/nodejs/report/html2docx';
import { ICommonParams } from '@feidao/service/interfaces';


export default async function atom(msg: ICommonParams, action_id: string, session_id: string, spaceid: string) {

	const data = '导出word';
	const tpl = '&lt;span>' + data + '&lt;/span>';

	// const h = render(data, tpl);
	const html = \`
&lt;!DOCTYPE html>
&lt;html>

	&lt;head>
		&lt;meta charset="UTF-8">
		&lt;meta http-equiv="X-UA-Compatible" content="ie=edge">
		&lt;meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		&lt;meta name="apple-mobile-web-app-capable" content="yes" />
		&lt;meta name="renderer" content="webkit">
		&lt;title>&lt;/title>
		&lt;link href="https://cdn.jsdelivr.net/npm/feidao-css/feidao.css" type="text/css" rel="stylesheet">
	&lt;/head>
	&lt;body>
	\${tpl}
	&lt;/body>
&lt;/html>
	\`;
	// 调用原子操作将html内容转换为buffer
	const pdf_info = await html2docx(html);
	const content = await zipfile({ file: pdf_info.buff, path: './docx/文件名称.pdf' });
	return {
		attachment: '压缩包名称.zip',
		buff: content,
		content_type: 'application/octet-stream'
	};
}
`;
